package com.plian.system.controller.sys.timing;

import com.plian.Tools.base.BaseController;
import com.plian.Tools.pagedata.PageData;
import com.plian.system.model.ListResult;
import com.plian.system.model.ObjResult;
import com.plian.system.service.sys.timing.TimingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "api/timing")
public class TimingController extends BaseController {
    @Autowired
    TimingService timingService;
    /**
     * 保存
     */
    @PostMapping(value = "/save")
    public ObjResult save(@RequestBody PageData pd) throws Exception {
        return timingService.save(pd);
    }
    /**
     * 修改
     */
    @PostMapping(value = "/edit")
    public ObjResult edit(@RequestBody PageData pd) throws Exception {
        return timingService.edit(pd);
    }
    /**
     * 根据id查询
     */
    @PostMapping(value = "/findid")
    public ObjResult findid(@RequestBody PageData pd) throws Exception {
        return timingService.findid(pd);
    }
    @PostMapping(value = "/del_id")
    public ObjResult del_id(@RequestBody PageData pd) throws Exception {
        return timingService.delid(pd);
    }
    @PostMapping(value = "/list")
    public ListResult list(@RequestBody PageData pd) throws Exception {
        return timingService.list(pd);
    }
    @PostMapping(value = "/timing_strat")
    public ObjResult manual_send(@RequestBody PageData pd) throws Exception {
        return timingService.timing_strat(pd);
    }

    @PostMapping(value = "/timing_end")
    public ObjResult timing_end(@RequestBody PageData pd) throws Exception {
        return timingService.timing_end(pd);
    }

}
